package yunwo.cn.yzstation.adapter;

import android.content.Context;
import android.view.View;
import android.widget.TextView;

import yunwo.cn.yzstation.R;
import yunwo.cn.yzstation.base.BasicAdapter;
import yunwo.cn.yzstation.bean.InventoryBean;

/**
 * Created by lao on 2017/8/31.
 */

public class Standardadapter extends BasicAdapter<InventoryBean.DataBean.ListBean> {
    public Standardadapter(Context mctx) {
        super(mctx);
    }

    @Override
    protected int setItemLayout() {
        return R.layout.select_waybill_adapter;
    }

    @Override
    protected void bindData(View convertView, InventoryBean.DataBean.ListBean data, int position) {
        TextView waybillTV = get(convertView, R.id.waybillTV);
        TextView consignee = get(convertView, R.id.consignee);
        TextView destinationTV = get(convertView, R.id.destinationTV);
        TextView stateTV = get(convertView, R.id.stateTV);
        waybillTV.setText(data.getTrackingNumber());
        consignee.setText(data.getConsigneeName());
        destinationTV.setText(data.getEndOrganName());
        switch (data.getTrackingStatus()) {

            case 1:
                stateTV.setText("派单中");

                break;
            case 2:
                stateTV.setText("待提货");

                break;
            case 3:
                stateTV.setText("拉包中");

                break;
            case 4:
                stateTV.setText("待发车");

                break;
            case 5:
                stateTV.setText("运输中");

                break;
            case 6:
                stateTV.setText("待配送");

                break;
            case 7:
                stateTV.setText("待签收");

                break;
            case 8:
                stateTV.setText("已签收");

                break;
            case 9:
                stateTV.setText("已取消");

                break;
        }

        /*待发车（库存）、运输中（进行中）、待配送（完成）*/
    }


}
